package com.aerfazhe.order.controller;

import com.aerfazhe.order.pojo.Order;
import com.aerfazhe.order.service.OrderService2;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author：wk
 * @Slogan：无论风雨，和自己一决胜负吧
 * @Create：2022/7/21/16:15
 * @Description：模拟分布式调用下单
 * @Version：1.0
 */
@RestController
@RequestMapping("/order2")
public class OrderController2 {

    @Resource
    private OrderService2 orderService2;

    /**
     * 下单
     * @param order 订单信息
     * @return
     */
    @PostMapping("/saveOrder")
    public Map<String, Object> saveOrder(@RequestBody Order order) {
       return orderService2.saveOrder(order);
    }




}
